package com.dykj.fireFighting.web.rocketmq.producer;

import com.dykj.fireFighting.web.rocketmq.message.ZcPushMessage;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zhengbo
 */
@Component
public class ZcPushProducer {
    @Autowired
    private RocketMQTemplate rocketMQTemplate;
    public void asyncSend(ZcPushMessage zcPushMessage, SendCallback callback) {
        // 异步发送消息
        rocketMQTemplate.asyncSend(ZcPushMessage.TOPIC, zcPushMessage, callback);
    }
}
